type DialogProps = {
    width?: string | number,
    fullscreen?: boolean,
    top?: string,
    modal?: boolean,
    modalClass?: string,
    headerClass?: string,
    bodyClass?: string,
    footerClass?: string,
    appendToBody?: boolean,
    appendTo?: string,
    lockScroll?: boolean,
    openDelay?: number,
    closeDelay?: number,
    closeOnClickModal?: boolean,
    closeOnPressEscape?: boolean,
    showClose?: boolean,
    beforeClose?: (done: () => void) => void,
    draggable?: boolean,
    overFlow?: boolean,
    center?: boolean,
    alignCenter?: boolean,
    destroyOnClose?: boolean,
    closeIcon?: string,
    zIndex?: number,
    headerAriaLevel?: string,

}

export type MorghulisDialogProps = DialogProps & {
    title?: string,
    subtitle?: string,
    confirm?: (data: any, done: () => void) => void,
    cancel?: (data: any, done: () => void) => void,
    confirmButtonText?: string
    cancelButtonText?: string
}


export const morghulisDialogPropsDefaults: MorghulisDialogProps = {
    width: 600,
    fullscreen: false,
    top: '30px',
    modal: true,
    modalClass: 'm-dialog-modal',
    headerClass: 'm-dialog-header',
    bodyClass: 'm-dialog-body-wrapper',
    footerClass: 'm-dialog-footer',
    appendToBody: true,
    appendTo: 'body',
    lockScroll: true,
    openDelay: 0,
    closeDelay: 0,
    closeOnClickModal: false,
    closeOnPressEscape: false,
    showClose: false,
    beforeClose: (done: Function) => done(),
    draggable: true,
    overFlow: false,
    center: false,
    alignCenter: false,
    destroyOnClose: true,
    title: '对话框',
    subtitle: '',
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    cancel: (data: any, done: () => void) => done(),
}

export type MorghulisDialogConfig = {
    title?: string,
    subtitle?: string
}